import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

import UserList from '@/components/UserList.vue';
import UserDetail from '@/components/UserDetail.vue';
const router = new VueRouter({
  // 声明路由规则
  routes: [
    // 路由重定向
    { path: '/', redirect: '/users' },
    { path: '/users', component: UserList },
    { path: '/users/:id', component: UserDetail },
  ],
});

export default router;
